<h3 class="widget-name">Leaves Applied </h3>

<table width="100%" class="table table-hover table-bordered table-condensed" id="example" >
  <thead>
  <tr>
    <th width="15%">Employee</th>    
    <th>Reason				</th>
	<th width="10%">Applied on</th>
    <th width="10%">Status</th>
    <th width="5%">Action</th>
  </tr>
  </thead>
 <tbody>
  <?php 
  foreach($all_leave as $leaves) {?>
<tr>
<td style="font-weight:bold"><?= $leaves->username?></td>
<td><?= $leaves->reason?>
	<br>
	<b class="text-info">Remark:</b> <?php if(!empty($leaves->remarks)){ echo ucfirst($leaves->remarks); } ?>
</td>
<td><?= $leaves->applied_on?></td>
<td>
<span class="<?php if($leaves->status == 'verified'){echo 'text-success';}else{echo 'text-error';}?>"><?= $leaves->status;?></span> on <span class="muted"> <?= $leaves->updated;?> </span>
</td>
<td><a href="<?= site_url('founder/leave_management/edit_leave_status/'.$leaves->id.'/'.$leaves->user_id);?>" title="Edit Leave" class="grant_leave tooltips" ><i class="icon-pencil"></i></a></td>
</tr>
  <?php }?>
</tbody>
</table>

<script type="text/javascript">

$('.grant_leave').click(function(event) {
  event.preventDefault();
  $.get(this.href, function(html) {
  $(html).appendTo('body').modal(); 
  });
});



</script>
